# 预祝数据文件

from flask import Blueprint
from flask.cli import with_appcontext

from modules.Tables import *  # 导入的模型

cli = Blueprint('cli', __name__)

# 模型类型数据预置
@cli.cli.command('insert_predefined_data')
@with_appcontext
def insert_predefined_data_command():
    if not Model_Type.query.first():
        model_type_names = ['物体检测', '图像分类', '语义分割', '实例分割', '异常识别', '视频分类', '目标追踪', '姿态估计']
        for model_type_name in model_type_names:
            model_type = Model_Type(model_type_name=model_type_name)
            db.session.add(model_type)
        db.session.commit()
        print('预置数据插入完成！')



